package com.ithema.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import net.minidev.json.annotate.JsonIgnore;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
@Data
public class Category {
    @NotNull(groups = {Update.class})
    private Integer id;//主键ID

    @NotEmpty(message = "分类名称不能为空",groups = {Insert.class, Update.class})
    private String categoryName;//分类名称
    @NotEmpty(message = "分类别名不能为空",groups = {Insert.class, Update.class})
    private String categoryAlias;//分类别名
    @JsonIgnore
    private Integer createUser;//创建人ID
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;//创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;//更新时间

    //分组校验
    public interface Insert{}
    public interface Update{}
}
